﻿using FlowCanvas;
using FlowCanvas.Nodes;
using UnityEngine;
using Yoozoo.Gameplay.Liberty.StreetEvent;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    public class SetHoldArenaCupUniqueId : CallableActionNode<int, bool>
    {
        public override void Invoke(int uniqueId, bool resetTimer)
        {
            StreetFightEvent.Instance.HoldCupUniqueId = uniqueId;
            if (resetTimer)
            {
                StreetFightEvent.Instance.HoldCupTimer = 0;
            }
        }

        protected override void OnRegisterExtraPorts(FlowNode node)
        {
            node.AddValueOutput<int>("uniqueId", () =>
            {
                return StreetFightEvent.Instance.HoldCupUniqueId;
            });
        }
    }
}